package com.bojx.report.service;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;

import com.bojx.report.dao.VerifyDao;
import com.bojx.report.pojo.Constant;
import com.bojx.report.util.ExcelUtil;
import com.jfinal.plugin.activerecord.Record;

public class VerifyService {
	private static VerifyDao verifyDao = new VerifyDao();

	/***
	 * 这里只验证第十一行的单元格对不对
	 * 
	 * @param sheet
	 * @throws Exception
	 */
	private void verifyFormat(Sheet sheet) throws Exception {
		String[] headers = new String[] { "业务量", "业务量", "电子商业承兑汇票", "电子银行承兑汇票", "全部商业承兑汇票", "全部银行承兑汇票" };
		HSSFRow row = (HSSFRow) sheet.getRow(10);

		String A11 = row.getCell(0).getStringCellValue().trim();
		String B11 = row.getCell(1).getStringCellValue().trim();
		String C11 = row.getCell(2).getStringCellValue().trim();
		String I11 = row.getCell(8).getStringCellValue().trim();
		String Q11 = row.getCell(16).getStringCellValue().trim();
		String W11 = row.getCell(22).getStringCellValue().trim();

		if (!headers[0].equals(A11)) {
			throw new Exception("文件格式不对,请按模板填，不要删除任何一行");
		}

		if (!headers[1].equals(B11)) {
			throw new Exception("文件格式不对,请按模板填，不要删除任何一行");
		}

		if (!headers[2].equals(C11)) {
			throw new Exception("文件格式不对,请按模板填，不要删除任何一行");
		}

		if (!headers[3].equals(I11)) {
			throw new Exception("文件格式不对,请按模板填，不要删除任何一行");
		}

		if (!headers[4].equals(Q11)) {
			throw new Exception("文件格式不对,请按模板填，不要删除任何一行");
		}

		if (!headers[5].equals(W11)) {
			throw new Exception("文件格式不对,请按模板填，不要删除任何一行");
		}

	}

	/**
	 * 校验表二的数据
	 * 
	 * @param sheet
	 * @throws Exception 
	 */
	private void verifyTable1(Sheet sheet) throws Exception {
		
		List<String> errorTips=new ArrayList<String>();
		//验证是不是数字
		//如果是空的则不验证，如果不为空则提示信息，只校验填还是不填
	    int[] rowNums=new int[]{4, 5, 6, 7, 8 ,9};
	    int[] colNums=new int[]{1,2,4,5,6,7,8};
		for(int i=0;i<rowNums.length;i++){
			HSSFRow row = (HSSFRow) sheet.getRow(rowNums[i]);
			for(int j=0;j<colNums.length;j++){
				Cell cell = row.getCell(colNums[j]);
				try{
					cell.getNumericCellValue();
				}catch(IllegalStateException e){
					errorTips.add(new String ("第"+(rowNums[i]+1)+"行，第"+(ExcelUtil.excelColIndexToStr(colNums[j]+1))+"列错误,请输入数字"));
				}   
			}
		}
		
		
		// 校验第3，9，12，15，18，21，24，27，30，33列的数据必须在0-100% 或者#DIV/0
		int[] columns = new int[] { 3, 9, 12, 15, 18, 21, 24, 27, 30, 33 };
		int[] rows = new int[] { 4, 5, 6, 7, 8 ,9};
		for (int i = 0; i < rows.length; i++) {
			HSSFRow row = (HSSFRow) sheet.getRow(rows[i]);
			for (int j = 0; j < columns.length; j++) {
				Cell cell = row.getCell(columns[j]);
				try{
					double value = cell.getNumericCellValue();
					if(value<0 || value>1){
						errorTips.add(new String ("第"+(rows[i]+1)+"行，第"+(ExcelUtil.excelColIndexToStr(columns[j]+1))+"列错误,取值应在0-100%"));
					}
				}catch(IllegalStateException e){
					//抛出此异常表明公式的值是#DIV/0
					//不需要处理
				}
			}

		}
		if(errorTips.size()!=0){
			throw new Exception(errorTips.toString());
		}
	}

	/***
	 * 校验表二中的数据
	 * 
	 * @param sheet
	 * @param bank
	 * @param year
	 * @param month
	 * @throws Exception
	 */

	private void verifyTable2(Sheet sheet, String bank, int year, int month) throws Exception {
		// 数据校验---本年累计i月=本年累计i-1+本期发生
		// fuck,so long noodles
		List<String> errorTips = new ArrayList<String>();
		for (int i = 13; i < 25; i = i + 2) {
			Row rowCurrent = sheet.getRow(i);
			Row rowTotal = sheet.getRow(i + 1);
			String area = rowCurrent.getCell(0).getStringCellValue();
			// 查询本期发生和本年累计，本期发生和本年累计分别位于两行上。
			// 如果本期发生和本年累计都为0 ,则不校验
			// 另外的情况都有查询上一个月的本年累计，如果上一个月的本年累计没有数据则跳过
			// 反之则进行校验--本年累计i月=本年累计i-1+本期发生
			// 1电子商业承兑汇票
			// 1.1签发

			Double caEdraftIssueQtyCurrent = rowCurrent.getCell(2).getNumericCellValue();
			Double caEdraftIssueAmtCurrent = rowCurrent.getCell(3).getNumericCellValue();
			Double caEdraftIssueQtyTotal = rowTotal.getCell(2).getNumericCellValue();
			Double caEdraftIssueAmtTotal = rowTotal.getCell(3).getNumericCellValue();

			try {
				compare(caEdraftIssueQtyCurrent, caEdraftIssueQtyTotal, Constant.QTY, Constant.CAEDRAFT, Constant.ISSUE,
						year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子商业承兑汇票累计签发笔数错误"));
			}
			try {
				compare(caEdraftIssueAmtCurrent, caEdraftIssueAmtTotal, Constant.AMT, Constant.CAEDRAFT, Constant.ISSUE,
						year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子商业承兑汇票累计签发金额错误"));
			}

			// 1.2贴现
			Double caEdraftDiscountQtyCurrent = rowCurrent.getCell(4).getNumericCellValue();
			Double caEdraftDiscountAmtCurrent = rowCurrent.getCell(5).getNumericCellValue();
			Double caEdraftDiscountQtyTotal = rowTotal.getCell(4).getNumericCellValue();
			Double caEdraftDiscountAmtTotal = rowTotal.getCell(5).getNumericCellValue();
			try {
				compare(caEdraftDiscountQtyCurrent, caEdraftDiscountQtyTotal, Constant.QTY, Constant.CAEDRAFT,
						Constant.DISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子商业承兑汇票累计贴现笔数错误"));
			}
			try {
				compare(caEdraftDiscountAmtCurrent, caEdraftDiscountAmtTotal, Constant.AMT, Constant.CAEDRAFT,
						Constant.DISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子商业承兑汇票累计贴现金额错误"));
			}
			// 1.3转贴现
			Double caEdraftRediscountQtyCurrent = rowCurrent.getCell(6).getNumericCellValue();
			Double caEdraftRediscountAmtCurrent = rowCurrent.getCell(7).getNumericCellValue();
			Double caEdraftRediscountQtyTotal = rowTotal.getCell(6).getNumericCellValue();
			Double caEdraftRediscountAmtTotal = rowTotal.getCell(7).getNumericCellValue();
			try {
				compare(caEdraftRediscountQtyCurrent, caEdraftRediscountQtyTotal, Constant.QTY, Constant.CAEDRAFT,
						Constant.REDISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子商业承兑汇票累计转贴现笔数错误"));
			}
			try {
				compare(caEdraftRediscountAmtCurrent, caEdraftRediscountAmtTotal, Constant.AMT, Constant.CAEDRAFT,
						Constant.REDISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子商业承兑汇票累计转贴现金额错误"));
			}
			// 2电子银行承兑汇票
			// 2.1签发
			Double baEdraftIssueQtyCurrent = rowCurrent.getCell(8).getNumericCellValue();
			Double baEdraftIssueAmtCurrent = rowCurrent.getCell(9).getNumericCellValue();
			Double baEdraftIssueQtyTotal = rowTotal.getCell(8).getNumericCellValue();
			Double baEdraftIssueAmtTotal = rowTotal.getCell(9).getNumericCellValue();
			try {
				compare(baEdraftIssueQtyCurrent, baEdraftIssueQtyTotal, Constant.QTY, Constant.BAEDRAFT, Constant.ISSUE,
						year, month, area, bank);
			} catch (Exception e) {

				errorTips.add(new String("第" + (i + 2) + "行,电子银行承兑汇票签发累计笔数错误"));
			}
			try {
				compare(baEdraftIssueAmtCurrent, baEdraftIssueAmtTotal, Constant.AMT, Constant.BAEDRAFT, Constant.ISSUE,
						year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子银行承兑汇票签发累计金额错误"));
			}
			// 2.2承兑
			Double baEdraftAcceptQtyCurrent = rowCurrent.getCell(10).getNumericCellValue();
			Double baEdraftAcceptAmtCurrent = rowCurrent.getCell(11).getNumericCellValue();
			Double baEdraftAcceptQtyTotal = rowTotal.getCell(10).getNumericCellValue();
			Double baEdraftAcceptAmtTotal = rowTotal.getCell(11).getNumericCellValue();
			try {
				compare(baEdraftAcceptQtyCurrent, baEdraftAcceptQtyTotal, Constant.QTY, Constant.BAEDRAFT,
						Constant.ACCEPT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子银行承兑汇票累计承兑笔数错误"));
			}
			try {
				compare(baEdraftAcceptAmtCurrent, baEdraftAcceptAmtTotal, Constant.AMT, Constant.BAEDRAFT,
						Constant.ACCEPT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子银行承兑汇票累计承兑金额错误"));
			}
			// 2.3贴现
			Double baEdraftDiscountQtyCurrent = rowCurrent.getCell(12).getNumericCellValue();
			Double baEdraftDiscountAmtCurrent = rowCurrent.getCell(13).getNumericCellValue();
			Double baEdraftDiscountQtyTotal = rowTotal.getCell(12).getNumericCellValue();
			Double baEdraftDiscountAmtTotal = rowTotal.getCell(13).getNumericCellValue();
			try {
				compare(baEdraftDiscountQtyCurrent, baEdraftDiscountQtyTotal, Constant.QTY, Constant.BAEDRAFT,
						Constant.DISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子银行承兑汇票累计贴现笔数错误"));
			}
			try {
				compare(baEdraftDiscountAmtCurrent, baEdraftDiscountAmtTotal, Constant.AMT, Constant.BAEDRAFT,
						Constant.DISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子银行承兑汇票累计贴现金额错误"));
			}

			// 2.4转贴现
			Double baEdraftRediscountQtyCurrent = rowCurrent.getCell(14).getNumericCellValue();
			Double baEdraftRediscountAmtCurrent = rowCurrent.getCell(15).getNumericCellValue();
			Double baEdraftRediscountQtyTotal = rowTotal.getCell(14).getNumericCellValue();
			Double baEdraftRediscountAmtTotal = rowTotal.getCell(15).getNumericCellValue();
			try {
				compare(baEdraftRediscountQtyCurrent, baEdraftRediscountQtyTotal, Constant.QTY, Constant.BAEDRAFT,
						Constant.REDISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子银行承兑汇票累计转贴现笔数错误"));
			}
			try {
				compare(baEdraftRediscountAmtCurrent, baEdraftRediscountAmtTotal, Constant.AMT, Constant.BAEDRAFT,
						Constant.REDISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,电子银行承兑汇票累计转贴现金额错误"));
			}
			// 3.全部商业承兑汇票
			// 3.1签发
			Double caDraftIssueQtyCurrent = rowCurrent.getCell(16).getNumericCellValue();
			Double caDraftIssueAmtCurrent = rowCurrent.getCell(17).getNumericCellValue();
			Double caDraftIssueQtyTotal = rowTotal.getCell(16).getNumericCellValue();
			Double caDraftIssueAmtTotal = rowTotal.getCell(17).getNumericCellValue();
			try {
				compare(caDraftIssueQtyCurrent, caDraftIssueQtyTotal, Constant.QTY, Constant.CADRAFT, Constant.ISSUE,
						year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部商业承兑汇票累计签发笔数错误"));
			}
			try {
				compare(caDraftIssueAmtCurrent, caDraftIssueAmtTotal, Constant.AMT, Constant.CADRAFT, Constant.ISSUE,
						year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部商业承兑汇票累计签发金额错误"));
			}
			// 3.2贴现
			Double caDraftDiscountQtyCurrent = rowCurrent.getCell(18).getNumericCellValue();
			Double caDraftDiscountAmtCurrent = rowCurrent.getCell(19).getNumericCellValue();
			Double caDraftDiscountQtyTotal = rowTotal.getCell(18).getNumericCellValue();
			Double caDraftDiscountAmtTotal = rowTotal.getCell(19).getNumericCellValue();
			try {
				compare(caDraftDiscountQtyCurrent, caDraftDiscountQtyTotal, Constant.QTY, Constant.CADRAFT,
						Constant.DISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部商业承兑汇票累计贴现笔数错误"));
			}
			try {
				compare(caDraftDiscountAmtCurrent, caDraftDiscountAmtTotal, Constant.AMT, Constant.CADRAFT,
						Constant.DISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部商业承兑汇票累计贴现金额错误"));
			}

			// 1.3转贴现
			Double caDraftRediscountQtyCurrent = rowCurrent.getCell(20).getNumericCellValue();
			Double caDraftRediscountAmtCurrent = rowCurrent.getCell(21).getNumericCellValue();
			Double caDraftRediscountQtyTotal = rowTotal.getCell(20).getNumericCellValue();
			Double caDraftRediscountAmtTotal = rowTotal.getCell(21).getNumericCellValue();
			try {
				compare(caDraftRediscountQtyCurrent, caDraftRediscountQtyTotal, Constant.QTY, Constant.CADRAFT,
						Constant.REDISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部商业承兑汇票累计转贴现笔数错误"));
			}
			try {
				compare(caDraftRediscountAmtCurrent, caDraftRediscountAmtTotal, Constant.AMT, Constant.CADRAFT,
						Constant.REDISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部商业承兑汇票累计转贴现金额错误"));
			}
			// 4.全部银行承兑汇票
			// 4.1签发
			Double baDraftIssueQtyCurrent = rowCurrent.getCell(22).getNumericCellValue();
			Double baDdraftIssueAmtCurrent = rowCurrent.getCell(23).getNumericCellValue();
			Double baDraftIssueQtyTotal = rowTotal.getCell(22).getNumericCellValue();
			Double baDdraftIssueAmtTotal = rowTotal.getCell(23).getNumericCellValue();
			try {
				compare(baDraftIssueQtyCurrent, baDraftIssueQtyTotal, Constant.QTY, Constant.BADRAFT, Constant.ISSUE,
						year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部银行承兑汇票累计签发笔数错误"));
			}
			try {
				compare(baDdraftIssueAmtCurrent, baDdraftIssueAmtTotal, Constant.AMT, Constant.BADRAFT, Constant.ISSUE,
						year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部银行承兑汇票累计签发金额错误"));
			}
			// 4.2承兑
			Double baDraftAcceptQtyCurrent = rowCurrent.getCell(24).getNumericCellValue();
			Double baDdraftAcceptAmtCurrent = rowCurrent.getCell(25).getNumericCellValue();
			Double baDraftAcceptQtyTotal = rowTotal.getCell(24).getNumericCellValue();
			Double baDdraftAcceptAmtTotal = rowTotal.getCell(25).getNumericCellValue();
			try {
				compare(baDraftAcceptQtyCurrent, baDraftAcceptQtyTotal, Constant.QTY, Constant.BADRAFT, Constant.ACCEPT,
						year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部银行承兑汇票累计承兑笔数错误"));
			}
			try {
				compare(baDdraftAcceptAmtCurrent, baDdraftAcceptAmtTotal, Constant.AMT, Constant.BADRAFT,
						Constant.ACCEPT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部银行承兑汇票累计承兑金额错误"));
			}

			// 4.3贴现
			Double baDraftDiscountQtyCurrent = rowCurrent.getCell(26).getNumericCellValue();
			Double baDraftDiscountAmtCurrent = rowCurrent.getCell(27).getNumericCellValue();
			Double baDraftDiscountQtyTotal = rowTotal.getCell(26).getNumericCellValue();
			Double baDraftDiscountAmtTotal = rowTotal.getCell(27).getNumericCellValue();
			try {
				compare(baDraftDiscountQtyCurrent, baDraftDiscountQtyTotal, Constant.QTY, Constant.BADRAFT,
						Constant.DISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部银行承兑汇票累计贴现笔数错误"));
			}
			try {
				compare(baDraftDiscountAmtCurrent, baDraftDiscountAmtTotal, Constant.AMT, Constant.BADRAFT,
						Constant.DISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部银行承兑汇票累计贴现金额错误"));
			}
			// 4.4转贴现
			Double baDraftRediscountQtyCurrent = rowCurrent.getCell(28).getNumericCellValue();
			Double baDraftRediscountAmtCurrent = rowCurrent.getCell(29).getNumericCellValue();
			Double baDraftRediscountQtyTotal = rowTotal.getCell(28).getNumericCellValue();
			Double baDraftRediscountAmtTotal = rowTotal.getCell(29).getNumericCellValue();
			try {
				compare(baDraftRediscountQtyCurrent, baDraftRediscountQtyTotal, Constant.QTY, Constant.BADRAFT,
						Constant.REDISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部银行承兑汇票累计转贴现笔数错误"));
			}
			try {
				compare(baDraftRediscountAmtCurrent, baDraftRediscountAmtTotal, Constant.AMT, Constant.BADRAFT,
						Constant.REDISCOUNT, year, month, area, bank);
			} catch (Exception e) {
				errorTips.add(new String("第" + (i + 2) + "行,全部银行承兑汇票累计转贴现金额错误"));
			}

		}

		if (errorTips.size() != 0) {
			throw new Exception(errorTips.toString());
		}
	}

	private void compare(Double current, Double total, String type, String billType, String actionType, int year,
			int month, String area, String bank) throws Exception {

		if (month == 1) {// 一月份不校验
			return;
		}
		// 查询上月累计数据
		Record qtyAmtRecord = verifyDao.queryQtyAndAmt(bank, area, billType, actionType, year, (month - 1));
		if (qtyAmtRecord == null) {
			return;
		}
		if ("qty".equals(type)) {
			int lastQty = qtyAmtRecord.getInt("qty");
			if ((current.intValue() + lastQty) != total.intValue()) {
				throw new Exception("error");
			}
		} else {// "amt".equal(type)
			float lastAmt = qtyAmtRecord.getFloat("amt");
			BigDecimal currentHalfUp = new BigDecimal(current).setScale(2, BigDecimal.ROUND_HALF_UP);
			BigDecimal lastAmtHalfUp = new BigDecimal(lastAmt).setScale(2, BigDecimal.ROUND_HALF_UP);
			;
			BigDecimal calTotal = currentHalfUp.add(lastAmtHalfUp);
			if (calTotal.compareTo(new BigDecimal(total).setScale(2, BigDecimal.ROUND_HALF_UP)) != 0) {
				throw new Exception("error");
			}
		}
	}

	public void verify(Sheet sheet, String bank, int year, int month) throws Exception {
		//查询有没有插入过数据
		Record record=verifyDao.queryRecord(bank, year, month);
		if(record!=null){
			throw new Exception("该月数据已提交");
		}
		verifyFormat(sheet);
		verifyTable1(sheet);
		verifyTable2(sheet, bank, year, month);
	}
	
	/**
	 * 验证银行对公网点数量和已加入电子商业汇票系统网点数量增加和减少都要提示
	 * 不变不提示
	 */
     public String verifyBranch(Sheet sheet,int year,int month,String bank){
    	 List<String> tips=new ArrayList<String>();
    	 //查询上月数据
    	 if(month==1){
			 year=year-1;
			 month=12;
		 }else{
			 month=month-1;
		 }
    	 for(int i=4;i<10;i++){
    		 Row row=sheet.getRow(i);
    		 Cell ACell=row.getCell(0);
    		 String area=ACell.getStringCellValue();
    		 
    		 Cell BCell=row.getCell(1);
    		 int branchQty=0;
    		 try{
    			 branchQty= Double.valueOf(BCell.getNumericCellValue()).intValue();
    		 }catch(IllegalStateException e){
    			 
    		 }
    		 
    		 Cell CCell=row.getCell(2);
    		 int eDraftBranchQty=0;
    		 try{
    			 eDraftBranchQty=Double.valueOf(CCell.getNumericCellValue()).intValue();
    		 }catch(IllegalStateException e){
    			 
    		 }
  
    		 //查询上个月的数据
    		 
    		 Record lastMonthRecord=verifyDao.queryLastMonthBranchRecord(bank, year, month, area);
    		 if(lastMonthRecord==null){
    			 return null;
    		 }
    		 
    		 int lastBranchQty=lastMonthRecord.getInt("branch_qty");
    		 int lastEDraftBranchQty=lastMonthRecord.getInt("edraft_branch_qty");
    		 
    		 //比较数据
    		 int branchQtyDif=branchQty-lastBranchQty;
    		 if(branchQtyDif>0){
    			 tips.add(new String(area+"对公网点数量增加"+branchQtyDif));
    		 }else if(branchQtyDif<0){
    			 tips.add(new String(area+"对公网点数量减少"+Math.abs(branchQtyDif)));
    		 }
    		 
    		 int eDraftBranchQtyDif=eDraftBranchQty-lastEDraftBranchQty;
    		 if(eDraftBranchQtyDif>0){
    			 tips.add(new String(area+"已加入电子商业汇票系统网点数量增加"+eDraftBranchQtyDif));
    		 }else if(branchQtyDif<0){
    			 tips.add(new String(area+"已加入电子商业汇票系统网点数量减少"+Math.abs(eDraftBranchQtyDif)));
    		 }
    	 }
    	 
    	 if(tips.size()!=0){
    		 return tips.toString();
    	 }
    	 return null;
     }
}
